home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgramD2.iso / Borland / Borland C++ For TASM / USRGUIDE.PAK / PRMSTACK.ASM < prev    next >
Assembly Source File  |  1996-02-21  |  559b  |  20 lines

  1. ; Turbo Assembler example. Copyright (c) 1993 By Borland International, Inc.
  2.  
  3. ; PRMSTACK.ASM  - Shows how to access stack parameters with BP offsets.
  4.  
  5. ; From the Turbo Assembler User's Guide, Ch. 18
  6.  
  7.        .MODEL  small
  8.        .CODE
  9.        PUBLIC  _Test
  10. _Test  PROC
  11.        push    bp
  12.        mov     bp,sp
  13.        mov     ax,[bp+4]          ;get parameter 1
  14.        add     ax,[bp+6]          ;add parameter 2 to parameter 1
  15.        sub     ax,[bp+8]          ;subtract parameter 3 from sum
  16.        pop     bp
  17.        ret
  18. _Test  ENDP
  19.        END
  20.